Saving and retrieving data based on public key encryption

ABSTRACT

In accordance with certain aspects, data is received from a calling program. Ciphertext that includes the data is generated, using public key encryption, in a manner that allows the data to be obtained from the ciphertext only if one or more conditions are satisfied. In accordance with another aspect, a bit string is received from a calling program. Data in the bit string is decrypted using public key decryption and returned to the calling program only if one or more conditions included in the bit string are satisfied.

RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.10/407,117, filed Apr. 4, 2003, entitled “Saving and Retrieving DataBased on Public Key Encryption”, which is hereby incorporated byreference herein. U.S. patent application Ser. No. 10/407,117 claimspriority to U.S. Provisional Application No. 60/373,505, filed Apr. 17,2002, entitled “Secure Store Processor”, which is hereby incorporated byreference.

A portion of the disclosure of this patent document contains materialwhich is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patent documentor the patent disclosure, as it appears in the Patent and TrademarkOffice patent file or records, but otherwise reserves all copyrightrights whatsoever.

TECHNICAL FIELD

This invention relates to saving and retrieving data, and particularlyto saving and retrieving data based on public key encryption.

BACKGROUND

Protecting data on computers so that the data is only disclosed toappropriate parties has become an important concern for users. The typesof data that users want to protect varies greatly, such as work-relatedor personal confidential documents, bank account numbers, credit cardnumbers, social security numbers, and so forth. Additionally, it is alsoimportant to some third parties to protect the data on the users'computers from improper use or access. For example, credit card issuerswant credit card numbers to be protected so that they are not disclosedto malicious programs or parties hacking into the computer, musiccompanies want songs to be protected so they cannot be copied, moviestudios want movies to be protected so they cannot be copies, and soforth.

One solution to protect data on computers is to do away withgeneral-purpose computing devices and use special-purposetamper-resistant boxes for delivery, storage, and display of securecontent. This solution, however, can be undesirable as it prevents usersfrom expanding their computers (e.g., users cannot install additionalsoftware components and/or hardware components on such tamper-resistantboxes). Thus, it would be beneficial to provide a way to allow data tobe protected on general-purpose computing devices.

SUMMARY

Saving and retrieving data based on public key encryption is describedherein.

In accordance with one or more aspects, data to be sealed and one ormore conditions that are to be satisfied in order for the data to beunsealed are obtained. Both the data and the one or more conditions areencrypted, using public key encryption, to generate a ciphertext thatincludes both the encrypted data and the encrypted one or moreconditions. The data is not unsealed if the one or more conditions arenot satisfied, one of the one or more conditions comprises a logicalformula to be evaluated, and the data can be unsealed only if thelogical formula evaluates true.

BRIEF DESCRIPTION OF THE DRAWINGS

The same numbers are used throughout the document to reference likecomponents and/or features.

FIG. 1 illustrates an exemplary access control model.

FIG. 2 shows an example access control environment employing fourdifferent hierarchical layers.

FIG. 3 is a flowchart illustrating an exemplary process for implementingthe Seal operation.

FIG. 4 is a flowchart illustrating an exemplary process for implementingthe UnSeal operation.

FIG. 5 is a flowchart illustrating an exemplary process for implementingthe Store operation.

FIG. 6 is a flowchart illustrating an exemplary process for implementingthe Seal operation.

FIG. 7 is a flowchart illustrating an exemplary process for implementingthe Quote operation.

FIG. 8 is a flowchart illustrating an exemplary process for implementingthe Verify operation.

FIG. 9 is a flowchart illustrating an exemplary process for implementingthe Seal operation

FIG. 10 is a flowchart illustrating an exemplary process forimplementing the PKSeal operation.

FIG. 11 is a flowchart illustrating an exemplary process forimplementing the GenSeal operation.

FIG. 12 illustrates a general computer environment, which can be used toimplement the techniques described herein.

DETAILED DESCRIPTION

FIG. 1 illustrates an exemplary access control model 100. A principal102 can make a request to access a protected resource. The request isreceived by a guard 104, which is a component that controls access to aresource 106. Guard 104 examines the request and decides whether togrant the request based on an access policy for the resource as well asother information, such as the identity of the principal 102 that issuedthe request. For ease of explanation, a single principal 102, guard 104,and resource 106 are illustrated in FIG. 1. However, it should be notedthat access control model 100 can include multiple principals 102,multiple guards 104, and/or multiple resources 106.

A principal 102 refers to a component or module that requests access toprotected data. This request may be a request to retrieve the protecteddata (e.g., a request for retrieval of a cryptographic key), or arequest to perform an operation(s) using the protected data (e.g., theprotected data could be a cryptographic key and the request could be arequest to encrypt or decrypt particular data using the cryptographickey). The principal 102 can be implemented as a component or module inhardware, software, firmware, or a combination of hardware, software,and/or firmware.

A guard 104 refers to a component or module that controls access to theprotected data. Guard 104 uses an access policy associated with theprotected data, as well as other information (such as the identity ofthe principal requesting access to the protected content), to determinewhether to allow the principal to access the protected data. If guard104 determines that the requesting principal is permitted to access theprotected data, then guard 104 responds to the request in an appropriatemanner (e.g., if the request is a request for the protected data, thenthe protected data is returned to the principal; or, if the request is arequest for particular data to be encrypted using the protected data,then guard 104 encrypts the particular data using the protected data andreturns the ciphertext (the encrypted data) to the principal). It shouldbe noted that guard 104 may restrict principals based on the nature ofthe request. For example, guard 104 may allow a particular principal tohave particular data signed using the protected data but may not allowthe protected data to be returned to the particular principal.

A guard 104 can also be characterized as a disclosure guard and/or aservice guard. A service guard performs certain operations (e.g.,encryption, decryption, digital signing, etc.) with the protected data(e.g., a cryptographic key) at the request of principals withoutdisclosing the protected data. A disclosure guard, on the other hand,reveals the protected data to authorized requestors. It should be notedthat a particular guard 104 can be both a disclosure guard and a serviceguard.

Resource 106 can be any type of data to which access is to berestricted. Examples of resources 106 include cryptographic keys, bankaccount numbers, credit card numbers, personal information such associal security numbers, passwords, and so forth. Resource 106 can alsobe virtually anything else in a computing device. For example, aresource 106 may also be physical memory (e.g., RAM or ROM), optical ormagnetic disks or disk drives, video cards, sound cards, smart cards,and so forth. By way of another example, a resource 106 may also beoperating system abstractions, such as processes, files, threads,semaphores, and so forth.

In the discussion herein, access control model 100 is describedpredominately with reference to being implemented on a single computingdevice. However, it is to be appreciated that different portions of themodel can be implemented on different computing devices. For example, aprincipal 102 may be on one computing device while a guard 104 andresource 106 may be on another computing device.

The principals and guards on a computing device can be categorized intoany number n of hierarchical layers 1 _(n). FIG. 2 shows an exampleaccess control environment employing four different hierarchical layers.In one implementation, layer 1 ₁ refers to a hardware or security kernellayer, layer 1 ₂ refers to a basic input/output system (BIOS) layer,layer 1 ₃ refers to an operating system (OS) layer, and layer 1 ₄ refersto an application layer.

In the example environment of FIG. 2, the lowest layer (layer 1 ₁)guards a root resource. Programs in the intermediate layers (layers 1 ₂and 1 ₃) act as principals that request access from the next lowerlayer, while at the same time act as guards towards principals in thenext higher layer. The intermediate layers can thus add functionalityfor principals in higher layers.

By way of example, assume that a program 120 desires to retrieve a rootresource 128 that is guarded by guard 126. Program 120 acts as aprincipal requesting access to the root resource 128 from module 122,which acts as a guard of the resource. If module 122 has a copy of theresource 128 (e.g., previously obtained from guard 126 in response to aprevious request for the resource by program 120 or some other programin layer 1 ₄, or when module 122 was initialized and loaded in thecomputing device), then module 122 checks whether program 120 is allowedto retrieve the resource. Module 122 then returns the resource toprogram 120 if program 120 is allowed to retrieve the resource.

However, if module 122 does not have a copy of the resource 128, thenmodule 122 acts as a principal requesting access to the root resourcefrom module 124, which acts as a guard of the resource. If module 124has a copy of the resource 128 (e.g., previously obtained from guard 126in response to a previous request for the resource by module 122 or someother module in layer 1 ₃, or when module 124 was initialized and loadedin the computing device), then module 124 checks whether module 122 isallowed to retrieve the resource. Module 124 then returns the resourceto module 122 if module 122 is allowed to retrieve the resource. Module122 then returns the resource to program 120 if program 120 is allowedto retrieve the resource.

However, if module 124 does not have a copy of the resource 128, thenmodule 124 acts as a principal requesting access to the root resourcefrom guard 126. Guard 126 checks whether module 124 is allowed toretrieve the resource, and returns the resource to module 124 if module124 is allowed to retrieve the resource. Module 124 then returns theresource to module 122 if module 122 is allowed to retrieve theresource, and module 122 returns the resource to program 120 if program120 is allowed to retrieve the resource.

In the discussion herein, multiple references are made to employingaccess control model 100 of FIG. 1 to allow authenticated operation ofsoftware. Typically, the resources being protected in authenticatedoperation of software are cryptographic keys. However, it is to beappreciated that authenticated operation of software is only one exampleof the use of access control model 100.

Another example of the use of access control model 100 is theauthentication of a user(s) to a computer. Most modern computers have anaccess control system. A user logs on to the computer so that thecomputer knows who the user is. After logging on, the user runs programsthat typically need to access system resources (e.g. read files, writeto windows on the screen, etc.). Typically, the access control system ofthe computer is consulted (e.g., “can user x perform operation y onresource z?”). If the answer is “no” the program cannot access theresource.

Another example of the use of access control model 100 is theauthentication of a user(s) to a remote service. Remote services such asweb sites (e.g., on-line brokers or banks) can be thought of as havingaccess control systems. The resources are people's bank accounts, theirmoney and their stocks. After a user logs on to the web site, the accesscontrol system will determine if the user is authorized to perform theaccesses requested by the user, such as a “read” access on the resource“bank account data” (to retrieve the latest bank statement), or a“transfer” access on the resource “$1000 in bank account 12345”.

Yet another example of the use of access control model 100 isrestricting physical access to particular buildings or areas. Forexample, when a user arrives at work in the morning, the user shows hisor her badge and requests the “open” operation on the resource “frontdoor”. Some electronic system (a guard) determines, based on informationstored on the badge, if the user is allowed to enter the building andunlocks the door accordingly.

A computing device enables authenticated operation of a program(software) if it is possible to let the program obtain protected access(from a disclosure guard or from a service guard) to at least onecryptographic resource. In certain embodiments, a computing device thatenables authentication and isolation, as described below, enablesauthenticated operation.

A program C can be referred to as being isolated from another program Dif two points are satisfied: (1) there is memory that can be accessed byprogram C but not by program D, and (2) program D cannot initiateexecution of program C (except, possibly, at an entry point(s)determined by program C). A program is given by its transition rules(executable code) and by its initial state (entry point(s) or initialvalue of the instruction pointer IP). The first point guaranteesintegrity of the program code and the state information of program C,even in the presence of adversarial behavior by program D, since datacan be stored in the memory that cannot be accessed by program D. Thispoint also allows program C to protect confidential data (e.g.,cryptographic keys) from observation by program D. The second pointguarantees that D cannot subvert the behavior of C by choosing the entrypoint adversarially.

Additionally, it can be said that a program C can authenticate a programD if program C is able to identify both the transition rules (programcode) and the initial state of program D. The computing device enablesisolation for any program C from any other program D, with the exceptionof a single program E_(j) for each layer j<i, where i is the layer ofprogram C. This protects programs from observation and interference byany program, except for the sequence E₁, E₂, . . . , E_(i−1) of guardsthrough which program C requests access to its resources. Furthermore,for any layer i, the computing device enables a program executing inlayer i to authenticate at least some programs in layer i+1. Thisrequirement allows a program to act as a guard for requests fromprincipals in the next layer. These two observations give rise to aninductive argument that programs in any layer can act as guards forresources by requesting access to a resource from their predecessor,protecting their integrity and the resource through isolation andauthenticating requests from principals in the next layer.

Isolation can be implemented by using physical memory protections. Thisapproach is referred to as “isolation in space” or “space isolation”.For example, the ring and virtual memory protections found in manymodern microprocessors are sufficient to implement isolation in space.An operating system kernel (layer i) running in privileged mode can setup page tables for applications (layer i+1), such that any applicationcan only access those parts of physical memory that the operating systemkernel chooses to map into the application's virtual address space.Furthermore, the kernel restricts applications' privileges so that theycannot change the memory mapping, and ensures that applications caninitiate execution of kernel code only at a well defined entry point(s)(system calls).

Another approach to implementing isolation between two layers is toseparate their execution in time. This approach is referred to as“isolation in time” or “time isolation”. A program in a first layer iexecutes to completion, makes certain resources unavailable, and thenterminates. Subsequently, control is transferred to the next layer i+1.

Authentication occurs between subsequent layers (j=i+1). Program Cauthenticates the program (transition rules) and the initial state ofthe configuration of j. The program can be authenticated by lettingprogram C inspect the program in layer j. That is, typically program Creads the memory, which contains the program for layer j, and computes acryptographic digest over this memory range. It should be noted that thegoal at this point is only to ascertain the identity of the code, not toevaluate statements made by other principals about the code. Thus,certificates are not necessary at this point.

The second task for program C is to identify the initial state ofprogram D. In general, the problem of determining the initial state of aprogram at an arbitrary execution stage is very difficult. Thus, programC controls the initial state of program D. In practical terms, thismeans that program C can only ascertain the initial state σ of program Dif program C initiates the execution of program D at σ.

In summary, in order to authenticate program D, program C inspects thememory contents it deems relevant (program and, possibly, data) andcomputes a cryptographic digest. After that, program C transfersexecution to a well-defined entry point of program D.

In situations where the resources are cryptographic keys, authenticatedoperation allows each operating system and application program to haveexclusive access to one or more secrets. The isolation discussed aboveprotects each secret from attacks by adversarial code. Theauthentication of programs discussed above allows programs to beidentified, such that each secret is disclosed only to the program thatowns it.

Generally, given a request from a program (a principal 102 of FIG. 1), aguard 104 establishes the identity of the program (that is, guard 104authenticates the program). If the program is not the owner of therequested secret (a resource 106), then guard 104 rejects the request.Otherwise, guard 104 computes some function of the secret (which may bethe secret itself) and, possibly, further information provided by theprogram and returns the result. Alternatively, rather than explicitlyaccepting or rejecting requests, guard 104 may service the request butbind the identity of the caller into the result. This alternate approachis appropriate, for example, if the result returned by the guard doesnot contain confidential information (e.g., requests to use a secret toproduce a digital signature). The term gating functions is used hereinto refer to both of these cases.

Additionally, in either case, guard 104 authenticates the caller(principal 102). Authenticating a principal 102 is also referred toherein by a function ID( ) which returns a digest of the calling program(the program calling a gating function of guard 104). The digest can begenerated in any of a wide variety of conventional manners, such asusing any one or more of a variety of cryptographic hash functions (alsoreferred to as one-way hash functions), such as SHA1 (Secure HashAlgorithm 1), MD5 (Message Digest 5), MD2 (Message Digest 2), etc.;using a keyed MAC (Message Authentication Code); and so forth.

One class of gating functions described herein implement sealed storage.The purpose of sealed storage is to allow programs to store secrets,such that only a particular set of one or more programs (defined by theprogram that stores the secret) can retrieve the secrets. In oneimplementation, only the program that originally saves (seals) thesecret can recover (unseal) the secret. Typically, the life time ofthese secrets will exceed the time of individual executions of theprogram. Secrets used during a single execution of a program can besaved (sealed), or alternatively isolation and a random number generatoralso allow a program to maintain secrets during a single execution.Sealed storage also allows a program to maintain secrets acrossdifferent executions, which may not overlap in time. A layer 1 _(i)exposes sealed storage to the next layer 1 _(i+1) by means of thefollowing interface (e.g., using the “Seal” and “UnSeal” operationsand/or PKSeal and PKUnseal operations).

The discussions herein regarding sealed storage refer to cryptographickeys being used to encrypt and decrypt data. These cryptographic keysare the keys associated with the guard that is guarding access to theresource (e.g., guard 104 of FIG. 1).

The discussions herein also refer to identifiers of programs (e.g., anidentifier of the program calling or invoking an operation, or anidentifier of a target program that is allowed to access a resource).These identifiers are often referred to herein as digests. However, itis to be appreciated that digests are only one example of identifiers ofprograms. Other types of identifiers that are a measure or otherrepresentation of the program and that allow any changes to the programto be detected can be used. If any changes are made to the program(e.g., one or more instructions being changed by an adversary in anattempt to maliciously gain access to and make use of the protecteddata) then the identifier of the program should reflect that change(e.g., the identifier for the unchanged program will be different thanthe identifier for the changed program).

The Seal operation receives, as an input, data (e.g., a secret) to besealed. The Seal operation also optionally receives, as an input, acondition that identifies when and/or to whom the secret may be revealed(unsealed). In one implementation, this condition is a digest of atarget program that is allowed to retrieve (unseal) the data.Alternatively, programs that are to be allowed to retrieve (unseal) thedata can be identified in other manners. For example, the programs maybe identified by a public key that verifies one or more certificates,with each certificate being associated with one or more of the programs.

Alternatively, other conditions may be used in addition to, or in placeof, an identifier of a target program. For example, the condition mayinclude particular time constraints for when the data can be revealed(unsealed), such as particular times of the day or days of the weekduring which the secret can be revealed (unsealed). By way of anotherexample, the condition may include an identifier of a password or otherdata that must be provided in order for the secret to be revealed(unsealed)—e.g., the secret can only be unsealed by programs havingknowledge of the password.

By way of yet another example, the condition can be a logical formula(e.g., any statement written in first order logic, any statement writtenin predicate logic, etc.). The logical formula is evaluated (e.g., bythe guard) and the secret is revealed (unsealed) only if the evaluationreturns an indication of true.

In still another example, the condition can be an executable program insome language (e.g., java, C*, Javascript, VBScript, etc.). The programis executed (e.g., by the guard) and the secret is revealed (unsealed)only if the program returns some indication of “true” or “satisfied”.

In situations where the condition is the digest of the target program,rather than being supplied with the digest of the target program, theSeal operation may use the digest of the program that invokes the Sealoperation (thereby implicitly inputting the digest of the targetprogram). Additionally, digests of multiple target programs can be inputto the Seal operation, thereby allowing multiple target programs toretrieve (unseal) the data.

The Seal operation encrypts its inputs (the data and the condition(s)allowing retrieval (unsealing) of the data) together with an identifierof the caller. The Seal operation returns the input data in an encryptedform (as ciphertext). The Seal operation also returns a value (e.g., amessage authentication code (MAC) value) that can be used to verify theintegrity of the sealed data. This returned data allows the stored datato be referenced in subsequent UnSeal operations, as discussed in moredetail below.

Pseudo code for the Seal operation is illustrated in Table I. In thepseudo code of Table I, ID( ) refers to the ID( ) function discussedabove, e refers to the value (e.g., a string or sequence of bits) thatis returned to the caller, data refers to the data to be sealed, and[t₁, . . . , t_(m)] refers to the digests of one or more (m) targetprogram(s) that are allowed to retrieve (unseal) the data (oralternatively one or more other conditions).

TABLE I d =ID( ) e = store (data, [t₁, ..., t_(m)], d) return e

FIG. 3 is a flowchart illustrating an exemplary process 200 forimplementing the Seal operation. Process 200 is performed by a guard 104of FIG. 1, and may be implemented in hardware, software, firmware, or acombination thereof.

Initially, a secret to be sealed is received from the caller (act 202).The secret is encrypted so that the secret can only be retrieved by aparticular target program(s) (act 204), or alternatively so that thesecret can only be retrieved if one or more particular conditions aresatisfied. Ciphertext including the encrypted secret is then returned tothe caller (act 206). Additional information may also be returned to thecaller (as part of the ciphertext or separate from the ciphertext), suchas a digest of the caller and/or digest(s) of the target program(s).

The UnSeal operation receives, as an input, a bit string that wasreturned by the Seal operation when sealing data (e.g., a cryptographickey) that the calling program now desires to retrieve. The UnSealoperation obtains the condition(s) for revealing the data and checkswhether those conditions are satisfied. For example, if the condition(s)included digest(s) of the one or more target program(s) that are allowedto retrieve (unseal) the data, then the UnSeal operation obtains thosedigest(s) and checks whether the calling program is one of the one ormore target program(s). If the calling program is not one of the one ormore target program(s) then the UnSeal operation fails and the requesteddata is not returned to the caller. However, if the calling program isone of the one or more target program(s), then the UnSeal operationsucceeds and the requested data is returned to the calling program. Thedigest of the program that sealed the data is also optionally returnedby the UnSeal operation.

Pseudo code for the UnSeal operation is illustrated in Table II. In thepseudo code of Table II, data refers to the data that is being requested(and that has been previously sealed), [t₁, . . . , t_(m)] refers to thedigests of one or more (m) target program(s) that are allowed toretrieve (unseal) the data (or alternatively one or more otherconditions), e refers to the input to the UnSeal operation (typicallypreviously output by a Seal operation), and d refers to the digest ofthe program that sealed the data.

TABLE II (data, [t₁, ..., t_(m)], d) = retrieve(e) if ID( ) is in [t₁,..., t_(m)] then return (data, d)     else fail

FIG. 4 is a flowchart illustrating an exemplary process 220 forimplementing the UnSeal operation. Process 220 is performed by a guard104 of FIG. 1, and may be implemented in hardware, software, firmware,or a combination thereof.

Initially, ciphertext with encrypted data that the caller desires toretrieve is received (act 222). A check is made as to whether the calleris allowed to retrieve the data (act 224), and processing proceeds basedon whether the caller is allowed to retrieve the data (act 226). If thecaller is allowed to retrieve the data, then the data (decrypted) isreturned to the caller (act 228). If the caller is not allowed toretrieve the data, then the process fails (act 230) and the data is notreturned to the caller.

Sealed storage can be implemented in different manners. In oneimplementation, sealed storage is implemented using physically protectednon-volatile memory. In this implementation, the computing deviceassociates different guards with different portions of the protectednon-volatile memory and allows each guard to access only those portionswhich are associated with that guard. In this implementation, the Storeand Retrieve operations referenced in the Seal and UnSeal operations areinvoked to have the computing device store and retrieve, respectively,the data in the protected non-volatile memory associated with the guard.

By way of example, a storage device (such as a hard disk drive) canimplement a guard. Rather than simply executing read and write commandsto the storage device unconditionally, the storage device identifies theprincipal attempting to access the storage device (e.g., based on adigest of the principal) and allows only a particular principal(s) toaccess the storage device. Alternatively, different principals may berestricted to accessing only particular portions of the storage device(e.g., particular sectors or address ranges).

In another implementation, sealed storage is implemented usingcryptography. A description of one exemplary implementation of sealedstorage using cryptography follows.

When using cryptography to implement sealed storage, the resource is akey K rather than physically protected memory. The Store operation doesnot physically store its inputs. Rather, the Store operation produces acryptographically protected output c, which is the inputs of the Storeoperation in an encrypted and integrity protected form. The encryptionis a result of applying a symmetric cipher to the input(s). The latterproperty results from applying a message authentication code (MAC) tothe input(s) (either before or after the input(s) is encrypted).

Pseudo code for the Store operation is illustrated in Table III. In thepseudo code of Table III, b refers to the bit string input to the Storeoperation, c refers to the bit string output by the Store operation, K1refers to a first part of the key K, and K2 refers to a second part ofthe key K. The key K is a symmetric key of the guard implementing theSeal and Store operations.

TABLE III m = MAC_(K1)(b) c = (m, Encrypt_(K2)(b)) return c

Thus, as can be seen in Table III, a value (m) is generated by applyinga MAC to the bit string input to the Store operation. The MAC is keyedto a portion (K1) of the key K. The bit string input to the storeoperation is also encrypted using a second portion (K2) of the key K.The values generated by applying the MAC to the input bit string and byencrypting the input bit string are then returned to the caller of theStore operation.

The key K is partitioned into two independent keys K1 and K2 in order toavoid using the same key for the MAC and the cipher. This partitioningcan be performed in any of a variety of manners. The partitions may usedifferent bits of the key K or alternatively may use one or more of thesame bits. For example, assuming that the key K is 1024 bits, then thelow 512 bits may be used as key K1 and the high 512 bits may be used askey K2, the even numbered bits (bits 0, 2, 4, 6, 8, 10, . . . , 1022)may be used as key K1 and the odd numbered bits (bits 1, 3, 5, 7, 9, 11,. . . , 1023) may be used as key K2, the low 650 bits may be used as keyK1 and the high 650 bits may be used as key K2 (resulting in some bitsbeing used for both K1 and K2), and so forth. Alternatively, the samekey K may be used for both the MAC and the cipher.

The pseudo code illustrated in Table III implements the Store operationby computing a MAC over the data, encrypting the data, and outputtingboth the MAC and the ciphertext. Alternatively, the Store operation maybe implemented in different manners. For example, the Store operationmay encrypt the data first, then compute a MAC over the ciphertext andoutput both the ciphertext and the MAC. By way of another example, theStore operation may compute a MAC over the data, then encrypt both thedata and the MAC, and output the ciphertext.

The encryption performed by the cipher of the Store operation can beperformed using any of a variety of symmetric encryption algorithms.Generally, symmetric encryption algorithms use the same key for bothencryption and decryption. Examples of such algorithms includetriple-DES (Data Encryption Standard), AES (Advanced EncryptionStandard), and so forth.

Similarly, the MAC can be any of a variety of message authenticationcodes, such as the MAC described in M. Bellare, R. Canetti, and H.Krawczyk, “Keying hash functions for message authentication,” inAdvances in Cryptology—Crypto'96, number 1109 in Lecture Notes in CS,1996. Alternatively, integrity can be protected by means of a public keydigital signature in place of a MAC.

FIG. 5 is a flowchart illustrating an exemplary process 250 forimplementing the Store operation. Process 250 is performed by a guard104 of FIG. 1, and may be implemented in hardware, software, firmware,or a combination thereof.

Initially, data to be stored is received (act 252). A symmetric cipheris applied to the data (act 254) and a message authentication code (MAC)is applied to the data (act 256). The encrypted data generated in act254 and the MAC value generated in act 256 are then returned to thecaller (act 258).

The Retrieve operation receives an input bit string that includes a MACvalue and ciphertext. The ciphertext is decrypted to generate plaintextand a MAC value is generated for the plaintext. If the MAC valuegenerated for the plaintext is the same as the MAC value received aspart of the input bit string, then the plaintext is returned to thecaller. However, if the MAC value generated for the plaintext is not thesame as the MAC value received as part of the input bit string, then theRetrieve operation fails and the plaintext is not returned to thecaller. It is to be appreciated that the specific manner in which theRetrieve operation is implemented to obtain the MAC and the ciphertextfrom the input bit string is dependent on the manner in which the Storeoperation is implemented

Pseudo code for the Retrieve operation is illustrated in Table IV. Inthe pseudo code of Table IV, c refers to the bit string input to theRetrieve operation, b refers to the bit string output by the Retrieveoperation, m refers to the MAC value portion of the bit string input tothe Retrieve operation, d refers to the ciphertext portion of the bitstring input to the Retrieve operation, K1 refers to a first part of thekey K, and K2 refers to a second part of the key K. The K1 and K2 keysare the same portions of the key K as discussed above with respect tothe Store operation.

TABLE IV Let (m, d) = c b =Decrypt_(K2)(d)) if m = MAC_(K1)(b) thenreturn b else fail

Thus, as can be seen in Table IV, a value (b) is generated by decryptingthe bit string input to the Retrieve operation. A MAC value is thengenerated for the value (b). If the MAC value generated by the Retrieveoperation is the same as the MAC value that is received as part of thebit string input to the Retrieve operation then the value (b) isreturned to the caller of the Retrieve operation, otherwise the Retrieveoperation fails.

The pseudo code of Table IV is based on the implementation of the Storeoperation where the MAC is computed over the data, the data isencrypted, and the MAC and ciphertext together are output (and serve asthe input bit string to the Retrieve operation). If the Store operationwere implemented to encrypt the data first, then compute a MAC over theciphertext and output both the ciphertext and the MAC, then the Retrieveoperation would be implemented to compute the MAC of the ciphertext andcompare it to the MAC value received as part of the input bit string,then decrypt the ciphertext and return the decrypted data if the MACvalues match. If the Store operation were implemented to compute a MACover the data then encrypt both the data and the MAC, then the Retrieveoperation would be implemented to decrypt the input bit string, thencompute a MAC over the data in the input bit string and compare thecomputed MAC to a MAC value in the decrypted string, and return the dataif the MAC values match.

Analogous to the discussion above regarding the Store operation, any ofa variety of decryption algorithms can be used by the Retrieveoperation. However, the decryption algorithm should correspond to theencryption algorithm so that the encrypted data can be decrypted.Similarly, any of a variety of message authentication codes can be usedas the MAC, but he message authentication code used should be the sameas the message authentication code used by the Store operation.

FIG. 6 is a flowchart illustrating an exemplary process 270 forimplementing the Seal operation. Process 270 is performed by a guard 104of FIG. 1, and may be implemented in hardware, software, firmware, or acombination thereof.

Initially, a ciphertext and MAC value are received (act 272). Theciphertext is decrypted to generate plaintext data (act 274). A messageauthentication code (MAC) is applied to the plaintext data to generate aMAC value (act 276) and a check is made as to whether the MAC valuegenerated in act 276 is equal to the MAC value received in act 272 (act278). Processing then proceeds based on whether the generated MAC valueis equal to the received MAC value (act 280). If the generated MAC valueis equal to the received MAC value, then the plaintext data is returnedto the caller (act 282). However, if the generated MAC value is notequal to the received MAC value, then the process fails (act 284) andthe plaintext data is not returned to the caller.

Thus, the cryptography approach to sealed storage substantiallyguarantees that any corruption of the value c (the output of the Storeoperation) can be detected, and that the value b (the input to the Storeoperation) cannot be retrieved without access to the key K2 (the keyused by the cipher to encrypt the value b).

Another class of gating functions implement remote authentication. Thepurpose of remote authentication is to allow programs to beauthenticated even in the absence of a strong physical coupling to theauthenticator (e.g., using servers or smart cards). In this situation,authentication is based on cryptography. That is, both entities gothrough a cryptographic authentication protocol. This involves theauthenticated configuration having access to a secret, which, dependingon the protocol, is typically a private key or a symmetric key.Additionally, the computing device can tie the use of theseauthentication secrets to the identity of the configuration (e.g., theprocessor and/or software) that requests their use. Thus, theauthenticator can establish the identity of the computing device, aswell as the software executing on it.

Two operations, the Quote operation and the PKUnseal operation, are therespective gating functions for public key signing and public keydecryption. The guard implementing these gating functions has access toa signing key Ks and a decryption key Kd. Both the signing key Ks andthe decryption key Kd are also referred to as the private key of apublic/private key pair. This public/private key pair is a key pair ofthe guard implementing the Quote and PKUnseal operations.

The Quote operation returns a public key signature over a combination of(e.g., the concatenation of) the input to the Quote operation and acondition that identifies when and/or to whom the secret may berevealed. Analogous to the Seal and UnSeal operations discussed above,revealing of the secret can be tied to any of a variety of conditions.In one implementation, the condition is an identifier of (e.g., digestof) the calling program.

Inherent in the signature is the assertion that the operation wasperformed at the request of the identified calling program. The Quoteoperation works in conjunction with a Verify operation, which typicallyexecutes on a device other than the device on which the Quote operationexecutes (e.g., on a remote server device, on a smart card, etc.). TheVerify operation performs a public key signature verification andretrieves and evaluates the identifier of the calling program (and/orother conditions for revealing the secret).

Pseudo code for the Quote operation is illustrated in Table V. In thepseudo code of Table V, ID( ) refers to the ID( ) function discussedabove, a refers to the data input to the Quote operation, and Ks refersto a signing key.

TABLE V d =ID( ) return sn=Signature_(Ks)(d, a)

Thus, as can be seen in Table V, the Quote operation obtains a digest ofthe calling program and receives an input value a. The Quote operationgenerates a digital signature (sn) of the input value a and the digestof the calling program using the signing key Ks. The input value a canbe generated by the calling program, or alternatively may be a valuethat is received from another component or device (e.g., from the devicethat will be performing the Verify operation). The digital signature isgenerated using public key cryptography.

FIG. 7 is a flowchart illustrating an exemplary process 300 forimplementing the Quote operation. Process 300 is performed by a guard104 of FIG. 1, and may be implemented in hardware, software, firmware,or a combination thereof.

Initially, input data is received from a caller (act 302). An identifierof the caller (an/or one or more other conditions for retrieving theinput data) is obtained (act 304) and a digital signature over thecombination of the input data and the identifier (and/or one or moreother conditions) of the caller is generated (act 306). The generateddigital signature is then returned to the caller (act 308).

The Verify operation performs a public key signature verification andretrieves and evaluates the identifier of the calling program. TheVerify operation receives a digital signature that was generated by aQuote operation, typically from a device other than the device on whichthe Verify operation executes (e.g., on a remote server device, on asmart card, etc.). The Verify operation extracts the digest of theprogram (e.g., an application program, operating system, firmwareprogram, etc.) that called the Quote operation from the received digitalsignature, and evaluates that digest to determine how to proceed.

Pseudo code for the Verify operation is illustrated in Table VI. In thepseudo code of Table VI, d refers to the digest of the program thatcalled the Quote operation, a refers to the value that was input to theQuote operation, and Sn refers to the digital signature received by theVerify operation as an input.

TABLE VI (d,a)=Extract_(Kv)(Sn) Evaluate (d)

Thus, as can be seen in Table VI, the Verify operation receives adigital signature and, using verification key Kv (which is the publickey of the public/private key pair that includes the signing key Ks)extracts the digest d and the value a from the signature. The Verifyprogram can then evaluate the digest d of the program that called theQuote operation. The manner in which the digest d is evaluated can vary.For example, the evaluation may involve comparing the digest d to a listof “approved” or “trusted” application programs.

FIG. 8 is a flowchart illustrating an exemplary process 320 forimplementing the Verify operation. Process 320 is performed by a guard104 of FIG. 1, and may be implemented in hardware, software, firmware,or a combination thereof.

Initially, a digital signature is received (act 322). Both theidentifier of the caller (and/or one or more other conditions forretrieving the input value) that quoted an input value (using the Quoteoperation) and the input value itself are extracted from the digitalsignature (act 324). The identifier of the caller (and/or the one ormore other extracted conditions) is then evaluated to determine how toproceed with the input value (act 326).

The PKUnseal operation is a version of public key decryption, which isgated on the identity of the caller (e.g., the digest of the callingprogram), or alternatively one or more other conditions. The result ofthe public key decryption of the input c to the PKUnseal operation isinterpreted as a pair (d, s), where s is a secret and d identifies aconfiguration (e.g., digest of a calling program) to which s may berevealed. If the caller of PKUnseal is not d then the PKUnseal operationfails. The input c to the PKUnseal operation is generated by a secondoperation PKSeal, which can be executed on a device other than thedevice on which the PKUnseal operation executes (e.g., on a remoteserver device, on a smart card, etc.). The PKSeal operation performs apublic key encryption of a pair (d, s). The PKUnseal and PKSealoperations can also be used to implement sealed storage.

Pseudo code for the PKUnseal operation is illustrated in Table VII. Inthe pseudo code of Table VII, ID( ) refers to the ID( ) functiondiscussed above, c refers to the input to the PKUnseal operation, [d1, .. . , d_(m)] refers to the digest(s) of the one or more calling programsto which s can be revealed (or alternatively one or more otherconditions), s refers to the protected data, and Kd refers to adecryption key (a private key of a public/private key pair associatedwith the guard that is implementing the PKUnseal operation).

TABLE VII ([dl, ..., d_(m)], s) = Decrypt_(Kd)(c) if ID( ) is in [dl,..., d_(m)] then return s else fail

Thus, as can be seen in Table VII, the PKUnseal operation decrypts theinput value a using public key decryption and the decryption key Kd. Thedecrypted input value includes the digest(s) [d1, . . . , d_(m)] of oneor more calling programs to which the protected data s is allowed to berevealed (or alternatively one or more other conditions identifying whenand/or to whom the protected data s is allowed to be revealed). ThePKUnseal operation also generates a digest of the calling program. Ifthe digest of the calling program is equal to one of the digests [d1, .. . , d_(m)], then the protected data s is returned to the callingprogram. However, if the digest of the calling program is not equal toone of the digests [d1, . . . , d_(m)], then the protected data s is notreturned to the calling program.

FIG. 9 is a flowchart illustrating an exemplary process 340 forimplementing the PKUnseal operation. Process 340 is performed by a guard104 of FIG. 1, and may be implemented in hardware, software, firmware,or a combination thereof.

Initially, ciphertext with encrypted data that the caller desires toretrieve is received (act 342). A check is made as to whether the calleris allowed to retrieve the data (act 344), and processing proceeds basedon whether the caller is allowed to retrieve the data (act 346). If thecaller is allowed to retrieve the data, then the data (decrypted usingpublic key decryption) is returned to the caller (act 348). If thecaller is not allowed to retrieve the data, then the process fails (act350) and the data is not returned to the caller.

The PKSeal operation is a version of public key encryption, which isgated on the identity of the caller (e.g., the digest of the callingprogram or one or more other programs). The PKSeal operation performs apublic key encryption of a pair (d, s), where s is a secret and didentifies one or more configurations (e.g., digests of a callingprogram) to which s may be revealed.

Pseudo code for the PKSeal operation is illustrated in Table VIII. Inthe pseudo code of Table VIII, c refers to the output of the PKSealoperation, [d1, . . . , d_(m)] refers to the digest(s) of the one ormore calling programs to which s can be revealed, s refers to theprotected data, and Ke refers to an encryption key.

TABLE VIII c=Encrypt_(Ke)([dl, ..., d_(m)], s) return c

Thus, as can be seen in Table VIII, the PKSeal operation receives as aninput the protected data s and digests [d1, . . . , d_(m)] of one ormore programs to which the protected data s can be revealed. The pair[d1, . . . , d_(m)], s is then encrypted using public key cryptographybased on the encryption key Ke. The encryption key Ke is the public keyof the guard that is intended to be able to decrypt the ciphertext. Theciphertext resulting from the public key encryption is then returned tothe calling program.

FIG. 10 is a flowchart illustrating an exemplary process 360 forimplementing the PKSeal operation. Process 360 is performed by a guard104 of FIG. 1, and may be implemented in hardware, software, firmware,or a combination thereof.

Initially, a secret to be sealed is received from the caller (act 362).The secret is encrypted using public key encryption so that the secretcan only be retrieved by a particular target program(s) (act 364), oralternatively only if one or more other conditions are satisfied.Ciphertext including the encrypted secret is then returned to the caller(act 366). Additional information may also be returned to the caller (aspart of the ciphertext or separate from the ciphertext), such as adigest of the caller and/or digest(s) of the target program(s).

The Quote and PKUnseal operations are intended to be used in connectionwith public key authentication protocols. Most public key authenticationprotocols can be straightforwardly adapted by replacing any call topublic key decryption, public key encryption, signing, and signatureverification by a call to PKUnseal, PKSeal, Quote, Verify, respectively.

In some situations, it is important to be able to obtain a random number(e.g., as a basis for generating cryptographic keys). Random numbers canbe obtained in a variety of different manners. In one implementation,the source of random numbers is a cryptographically strong random numbergenerator implemented in the hardware of the computing device.

One alternative to the Seal operation discussed above is a GenSealoperation that combines the Seal operation with a generate random numberoperation. The GenSeal operation receives as input the digests [t1, . .. , t_(m)] of target program(s) that should be able to retrieve thesecret (and/or other conditions that must be satisfied in order for thesecret to be retrieved). The GenSeal operation generates a random numberand seals the newly generated random number so that it can be retrievedonly by calling programs having one of the target digest(s) [t1, . . . ,t_(m)] (and/or the other conditions satisfied).

Pseudo code for the GenSeal operation is illustrated in Table IX. In thepseudo code of Table IX, ID( ) refers to the ID( ) function discussedabove, c refers to the output of the GenSeal operation, s refers to thenewly generated random number, [t1, . . . , t_(m)] refer to one or moretarget program(s) that should be permitted to retrieve the value s (oneof which may optionally be the program calling the GenSeal operation) oralternatively one or more other conditions, and GenRandom( ) refers to afunction that generates a random number.

TABLE IX d =ID( ) s =GenRandom( ) c = store (s, [tl, ..., t_(m)], d)return c

FIG. 11 is a flowchart illustrating an exemplary process 380 forimplementing the GenSeal operation. Process 380 is performed by a guard104 of FIG. 1, and may be implemented in hardware, software, firmware,or a combination thereof.

Initially, an input is received from a caller that identifies a targetprogram(s) that should be able to retrieve a secret (act 382), oralternatively one or more other conditions that are to be satisfied inorder for the secret to be retrieved. A secret is then generated (act384), and the secret is encrypted so that the secret can only beretrieved by the identified target program(s) (act 386), oralternatively so that the secret can be retrieved only if the one ormore other conditions are satisfied. Ciphertext including the encryptedsecret is then returned to the caller (act 388). Additional informationmay also be returned to the caller (as part of the ciphertext orseparate from the ciphertext), such as a digest of the caller and/ordigest(s) of the target program(s).

The services provided by a disclosure guard can be used forgeneral-purpose sealing services. For example, referring back to FIGS. 1and 2, layer n−1 reveals a single key to layer n based on the identityof layer n on initialization (e.g., after reset or booting of thecomputing device, or upon beginning execution of a program). Layer ncaches this key and uses it to encrypt additional secrets. The next timethe platform is booted into the same configuration, the disclosure guardprovides the same root-key (e.g., through UnSeal or PKUnseal), and allthe secrets previously encrypted can be retrieved by layer n.

In certain embodiments, a lower layer discloses one or more secrets tothe next layer when that next layer is initialized (e.g., after reset orbooting of the computing device, or upon beginning execution of aprogram). Following this gated disclosure, the lower layer is no longerused (until the next boot or reset). This use-model is also referred toas the disclosure guard model. By employing the disclosure guard model,accesses to the lower layer are reduced.

The gating functions discussed herein can be used with service guardsand disclosure guards implemented using time isolation and spaceisolation. Four service model implementations for authenticatedoperation are discussed below: (1) service guard—space isolation; (2)disclosure guard—space isolation; (3) disclosure guard—time isolation;(4) service guard—time isolation. In the discussion of these servicemodels, assume that a lower-level guard has disclosed one or more keysto the guard at the layer being considered. The manner in which thesekeys are obtained depends on the guard and isolation model of the layerbeneath. Different layers on the same computing device can use differentones of these service models.

(1) Service guard—space isolation: The guard measures and saves theidentity of the requesting program when it is initialized. The guardimplements a protection system using processor services (e.g., of a CPUor some other security processor or co-processor), and a system-callinterface exposing the authenticated operation primitive operations.

(2) Disclosure guard—space isolation: The guard obtains service requestson initialization in the form of cryptographic blobs. The blobs could bestored in memory, or alternatively obtained from external storagedevices. The guard measures the identity of programs that itinitializes, and discloses keys to programs according to the gatingfunctions described above. Before relinquishing control to the nextlayer, the guard establishes mode-protection for itself and its secretresources.

(3) Disclosure guard—time isolation: The guard obtains service requestson initialization in the form of cryptographic blobs (groups of bits).The blobs could be stored in memory, or alternatively obtained fromexternal storage devices. The guard measures the identity of programsthat it initializes, and discloses keys to programs according to thegating functions described above. Before passing control to theseprograms, the guard deletes (or otherwise makes inaccessible) the keysused to implement the gating functions.

(4) Service guard—time isolation: In the service guard—time isolationmodel, the computing device securely preserves program state across thesecurity reset. This model is similar to model (1) (service guard—spaceisolation), however, before passing control to the next layer, theservice guard deletes its secret (rendering it non-functional until thenext reboot). The next layer will now execute normally, until it needsto request a service from the guard. At that point, it stores theparameters of the request somewhere in memory where they will survive areset and performs a reset. As the device reboots, the service guardobtains its secret, sees the request, executes it (using its key),destroys the key and any related information, and passes the result ofthe computation and control to the next layer (the layer that hadoriginally requested the service).

In certain embodiments, if a computing device supports space isolation,then the security kernel should expose the primitives (operations) Seal,Unseal, GetRandom (to obtain a random number), and PKUnseal (or Quote).The security kernel can implement a disclosure guard or a service guard.On the other hand, if the platform supports time isolation, then thesecurity kernel should provide a disclosure guard, and should implementthe primitives (operations) Unseal, GenSeal, and PKUnseal (or Quote).

It should also be noted that Quote and PKUnseal functionality can bebuilt on the Seal and Unseal or Unseal and GenSeal primitives. Forexample, manufacturers can build an 1 ₂ program(s) that implements Quoteor PKUnseal and acts as a host for higher-level software (e.g.,operating systems) upon GenSeal and Unseal implemented in 1 ₁. Themanufacturer can generate and Seal the keys needed by the service layerand ship them with the device or CPU (or make them available online).

An exemplary description of a family of hardware implementations thatwill enable platforms to support authenticated operation follows. Aswith higher layers in the system, the characteristics of the lowestlayer (1 ₁ of FIG. 2) are: (a) secret key resources, (b) privileged codethat has access to these keys, and (c) controlled initialization of thelayer.

Authenticated operation provides a strong binding between programs andsecret keys. At higher layers, guards in lower layers guarantee thisbinding. At the lowest layer, there is no underlying software guard thatcan gate access to the platform secrets. Thus, another mechanism is usedto support the association of the 1 ₁ keys to the 1 ₁ program. One wayof accomplishing this binding is having 1 ₁ software be platformmicrocode or firmware that is not changeable following manufacture, andgive the 1 ₁ software unrestricted access to the 1 ₁ keys. This platformmicrocode or firmware can then be referred to as the security kernel,and the 1 ₁ keys referred to as the platform keys. The platform isdesigned to only pass control to a predetermined security kernel. Thehardware behavior can also be explained as a simple resource guard thatdiscloses the platform keys to the predefined security kernel.

The platform keys and the security kernel firmware can be part of theprocessor or alternatively implemented in one or more other componentsin the computing device (e.g., a security processor or coprocessor,which may also perform cryptographic operations). The platform keys andthe security kernel firmware can be implemented in a single component,or alternatively implemented in multiple components of the computingdevice.

With authenticated operation, programs are started in a controlledinitial state. At higher levels, the software running at lower levelscan be entrusted to start execution at the correct entry point. At 1 ₁,however, hardware performs this function. Typically, on power-up orfollowing reset, current processors begin execution by following somedeterministic sequence. For example, in the simplest case the processorstarts fetching and executing code from an architecturally-definedmemory location. For 1 ₁ programs can be started in a controlled initialstate by the hardware ensuring that the security kernel is the code thatexecutes on startup (as part of the deterministic sequence).

Additionally, no other platform state should be able to subvertexecution of the security kernel. Reset and power-up provide a robustand a well-debugged state-clear for the processor. As used in thisexample, the platform state change that is used to start or invoke thesecurity kernel is referred to as a security reset.

Furthermore, a device manufacturer should arrange for the generation orinstallation of the platform keys used by the 1 ₁ implementation of Sealand Unseal. If the device is to be recognized as part of a PKI (PublicKey Infrastructure), the manufacturer should also certify a public keyfor the platform. This can be a platform key used directly by 1 ₁, oralternatively a key used by a higher layer.

Key generation and certification can be the responsibility of the CPUmanufacturer or alternatively some other party, such as the OEM thatassembles the CPU into a device. Alternatively, the responsibility canbe shared by multiple such parties.

Once the security kernel is executing it can use the isolationmechanisms described above to protect itself from code executing athigher layers. Isolation in space will typically involve privilege modesupport, and isolation in time will typically involve secrets beinghidden from upper layers.

No additional platform support is needed to support space isolation onmost current processors—an existing privilege mode or level will suffice(as long as the hardware resource that allows access to the platform keycan be protected from higher layers).

To support time isolation, hardware assistance is used to allow thesecurity kernel to conceal the platform key before passing control tohigher layers. One way to provide platform key security in the timeisolation model is to employ a stateful guard circuit that is referredto as a reset latch. A reset latch is a hardware circuit that has theproperty that it is open following reset or power-up, but any softwareat any time can programmatically close the latch. Once closed, the latchremains closed until the next reset or power-up. A platform thatimplements a time-isolated security kernel should gate platform keyaccess on the state of a reset latch, and the security kernel shouldclose the latch before passing control to higher layers. As mentionedabove, the security kernel should also take additional actions such asclearing memory and registers before passing control, but these actionare the same as those used at higher levels.

If the platform employs space isolation then the security kernel usesprivilege modes to protect itself and its platform keys from programs(e.g., operating systems) that it hosts. Furthermore, the securitykernel establishes a system call interface for invocation of theauthentication operations.

If the platform employs space isolation, then the platform should alsocontain storage that survives a security reset to pass parameters toservice routines. To invoke a service, an operating system prepares acommand and parameter block in a memory location known to the securitykernel and performs a security reset. If the OS wishes to continueexecution following the service call (as opposed to a simple restart)then it and the security kernel should take extra measures to ensurethat this can be done reliably and safely.

The authenticated operation discussed herein can be used for security ina variety of settings, such as protecting personal data from viruses,protecting confidential server data from network attacks, networkadministration, copy protection, trustworthy distributed computing, andso forth. The authenticated operation allows different programs, whichcan execute on the same computer without being in a particular trustrelationship, to preserve their cryptographic resources irrespective ofthe actions of other software.

Some of the discussions below make reference to an SSP (Secure ServiceProcessor). In one embodiment, an SSP is a processor (for use in acomputing device) that provides basic cryptographic services to acomputing device (e.g., the SSP supports the gating functions describedherein (e.g., as layer 1 ₁ of FIG. 2)). The SSP can make use ofcryptographic keys, and typically has one or more cryptographic keysthat are unique (or expected to be unique) to that SSP. The SSP can bepart of the CPU(s) of the device, or alternatively one or more otherprocessors. For example, the SSP may be a separate chip or integratedcircuit (IC) in a computing device.

In a different embodiment, an SSP is an appropriately isolated softwareprogram that exposes the same functionality to its callers as theprevious embodiment does. The SSP embodiment has access (directly orindirectly) to cryptographic keys. A number of implementation optionsexist for providing such access. For example, the SSP may call serviceor disclosure guards in lower layers. Or the SSP may have exclusiveaccess to some part of persistent memory (e.g. hard disk, flash memory,ROM, etc.) that contains the required cryptographic key(s).

In summary, an SSP is defined by the functionality it exposes toprincipals in a higher layer. An SSP is a guard (as described above)with access (direct or indirect) to cryptographic keys. The SSP usesthese keys to provide cryptographic services to its callers. Thefollowing sections will describe exemplary functionality an SSP exposes.

Example Operations

The following is a discussion of example implementations of sealedstorage operations and of remote authentication operations. This sectionillustrates example implementations of the Seal, UnSeal, Quote, andPKUnseal operations discussed above.

The following definitions are used in this section:

Name Type Description DIGEST BYTE[20] 160-bit value. Commonly the outputof a SHA-1 hash operation. SECRET BYTE[32] 256 bit value. Commonly asecret to be sealed or pksealed. ordinal INTEGER The ordinal componentof each input and output structure identifies the operation to which itbelongs and whether it is an input or an output structure. K_(M) 256-bitkey Key for HMAC operations. K_(S) 256-bit key AES key for Seal andUnSeal. K_(U) 2048 bits * 3 RSA key pair for PKUnseal K_(Q) 2048 bits *3 RSA key pair for Quote. R 128 bits Random number

Additionally, access policies are referred to in this section and theBound Key Operations section below. The access policy describes when theparticular operations are functional (that is, when they will work). Theuser of a computing device is able to selectively switch off certainfunctions. For example, the computing device (e.g., a SSP thatimplements the Seal operation) includes a register called FeatureEnable.One of the bits in the register is called MainEnable. If the user setsMainEnable to false then none of the functions in these sections willwork any more. The access policy description included with each functiondescribes under which FeatureEnable settings the function will work.

Seal Definition SSP_STATUS Seal (  [in] SECRET S,  [in] DIGEST Target[2],  [in] UINT32 MaxLen,  [out] UINT32* ActualLen,  [out] BYTE*SealedBlob ) Parameters Seal-Input ::= SEQUENCE {  ordinal INTEGER, secret Secret,  target DigestPair } Seal-Output ::= SEQUENCE {  ordinalINTEGER,  status INTEGER,  sealed-blob  OCTET STRING } Return ValuesSSP_SUCCESS

Comments

The Seal operation forms an encrypted blob (group of bits) that can onlybe decrypted by the corresponding Unseal operation if the followingevaluate true:

-   -   Is the encoding correct?    -   Is the MAC correct?    -   Is the currently running SK/SL (Security Kernel or Secure        Loader) the one named as the Target during the Seal operation?

Seal adds internal randomness so that the output of the Seal operationon the same input produces different results. This ensures that Sealcannot be used as a hardware device identifier. Seal also includes anidentifier of the program calling the Seal operation (e.g., a digest ofthe calling program saved in a PCR register of the SSP, also referred toherein as the PCR value) when the seal was performed to provideintegrity information to the unsealer.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UseSymmKey==All|FeatureEnable.UseSymmKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UseSymmKey)

Actions

The Seal operation implements the following actions:

1. Generate a 128-bit random number R

2. Let D0 be the current value of the PCR[0], D1=PCR[1]

3. DIGEST M=HMAC[K_(M)](R∥S∥target∥D0|D1)

4. C=AES[K_(S)](R∥S∥Target|D0∥D1∥M)

5. Return SSP_SUCCESS with SealedBlob set to C

Unseal Definition SSP_STATUS Unseal (  [in] BYTE* SealedBlob,  [in]UINT32 SealedBlobLen,  [out] SECRET S,  [out] DIGEST Source ) ParametersUnseal-Input ::= SEQUENCE {  ordinal INTEGER, sealed-blob OCTET STRING }Unseal-Output ::= SEQUENCE {  ordinal INTEGER,  status INTEGER,  secretSecret, source   Digest } Return Values SSP_SUCCESS SSP_UNSEAL_ERROR

Comments

The Unseal operation internally decrypts a blob generated by the Sealoperation and checks the following conditions:

-   -   Is the encoding correct?    -   Is the current value of the PCR the one named as the Target        during the Seal operation?

If all checks succeed, then the secret and the sealer's PCR is returned;otherwise an UNSEAL_ERROR is returned.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UseSymmKey==All|FeatureEnable.UseSymmKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UseSymmKey)

Actions

The Unseal operation implements the following actions:

1. M=AES−1[K_(S)](SealedBlob).

2. Interpret M as (BITS[128]R∥SECRET S1∥DIGEST Target0∥DIGESTTarget1∥DIGEST Sealer0∥DIGEST Sealer1∥DIGEST N).

3. DIGEST D=HMAC[K_(M)](R∥S1∥Target0∥Target1∥Sealer0∥Sealer1).

4. If (Target0!=PCR[0]∥Target1!=PCR[1]) return SSP_UNSEAL_ERROR with S,Source set to zero.

5. If D!=N return SSP_UNSEAL_ERROR with S, Source set to zero.

6. Else return SSP_SUCCESS with S set to S1 and Source set to {Sealer0,Sealer1}.

Quote Definition SSP_STATUS Quote(   [in] BITSTRING d-ext,   [out]PKSignature SigBlob ) Parameters Quote-Input ::= {   ordinal INTEGER,  d-ext Digest } Quote-output ::= {   ordina l INTEGER,   statusINTEGER,   sig-blob PKSignature } Return Values SSP_SUCCESSSSP_CRYPTO_ERROR

Comments

The Quote operation instructs the SSP to sign the concatenation of theexternally supplied D-EXT and the internal PCR value.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The Quote operation implements the following actions:

1. The SSP forms a message M consisting of the concatenation of theidentifier for message type QuoteMessage, D-EXT and the contents of thePCR register, under DER (Distinguished Encoding Rules) encoding:

SEQUENCE { message-typePKMessageType, d-ext Digest, pcr DigestPair }

2. The SSP then uses K_(Q), PRIV to generate a signed message over Maccording to the default implementation of RSASSA-PSS-SIGN as specifiedin PKCS #1 V2.1. If the function returns an error then returnSSP_CRYPTO_ERROR with SigBlob set to 0.

3. The SSP returns SSP_SUCCESS and the signature value just calculatedtogether with signatureAlgorithm=rSASSA-PSS-Default-Identifier inSigBlob.

PKUnseal Definition SSP_STATUS PK_Unseal(   [in] PKCiphertextSealedBlob,   [out] SECRET Secret ) Parameters PkUnseal-Input ::= {  ordinal INTEGER,   pk-sealed-blob PKCiphertext } PkUnseal-output ::= {  ordinal INTEGER,   status INTEGER,   secret Secret } Return ValuesSSP_SUCCESS SSP_CRYPTO_ERROR SSP_BAD_DATA_ERROR

Comments

The PKUnseal operation takes an encrypted blob of length 416 bits, andof a particular format. The blob is decrypted, and if the decryption anddecoding is successful, the 416-bit message is interpreted as theconcatenation of a secret value and the PCR value that is permitted toreceive the decrypted value.

If the current PCR value is equal to that specified in the encryptedblob, the secret is revealed; otherwise an error is returned.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The PKUnseal operation implements the following actions:

1. The SSP tests if the AlgorithmIdentifier in pk-sealed-blob issspV1BoundKey.

2. The SSP internally decrypts SealedBlob according to the defaultimplementation of RSAES-OAEP-DECRYPT as specified in PKCS #1 V2.1,obtaining a plaintext message M.

3. If the output of the decoding operation is “decoding error” returnSSP_BAD_DATA_ERROR with Secret set to zero.

4. Otherwise, the recovered message M should be of the following formunder DER encoding:

SEQUENCE { message-typePKMessageType,   secret Secret,   target Digest }

Furthermore, Secret should consist of 256 bits (=32 octets) and targetshould consist of 160 bits (=20 octets). The message type should besspV1PKSealedMessage. If any of these conditions is not met, returnSSP_BAD_DATA_ERROR with Secret set to zero, otherwise:

1. If target!=PCR return SSP_BAD_DATA_ERROR with Secret set to zero.

2. If target==PCR return SSP_SUCCESS with Secret set to secret.

Bound Key Operations

Additionally, a set of bound key functions or operations allowcryptographic keys to be created and certified locally (e.g., by theSSP), and also allow cryptographic keys to be communicated fromtrustworthy remote parties (e.g., communicated to the SSP).

Bound key functionality is characterized as follows:

-   -   1. A service guard (e.g. SSP) at some system layer accesses a        bound key directly. Each bound key has an associated        condition(s) that determines which guard(s) may access the bound        key. The condition(s) is expressed implicitly. That is, the        bound key is encrypted, such that only one or some set of guards        have the keys to decrypt it.    -   2. A service guard with access to a bound key exposes functions        that require the use of the bound key (e.g. signing, MAC,        encryption, decryption) to principals in a higher layer. Each        bound key may have an associated usage condition(s), in which        case the guard will only service requests that satisfy the        associated condition(s).    -   3. Bound keys are contained in cryptographically protected data        structures (also referred to herein bound key blobs). Bound key        blobs are self protecting and can be stored outside trusted        environments.        Bound keys have the following benefits:    -   Each principal can be allowed to have its own bound key.        Furthermore, each principal can be allowed to have arbitrarily        many bound keys. This allows for more fine grained policy        settings and improves privacy in certain applications. Thus,        guards need not be restricted to having only one or a few keys        that are used to service requests from all principals.    -   The bound key is not disclosed outside the authorized service        guard(s). Thus, a compromise of a principal (e.g. due to a        programming error) will not lead to a compromise of any bound        key. In one embodiment, the service guard (SSP) is implemented        in hardware. In this case, bound keys cannot be compromised due        to malicious or incorrect software.

The bound key functions provide protection for cryptographic keys. Boundkeys can be generated by remote parties or they can be created locallythrough the GenBoundKey command.

Bound keys that are generated locally may emit a “quote” certificatethat can be used to provide remote parties with evidence of the type ofthe public key, the type of key generated, the state of the machineduring generation, and the (optional) condition (e.g. digests) to whichthe key is bound.

Bound keys include one or more of the following elements:

-   -   The key usage (e.g., BoundSign, BoundQuote, BoundPkUnseal,        BoundPkDecrypt, BoundMAC, BoundEncrypt, or BoundDecrypt). This        element is optional. If included, this element restricts the        bound key to being used only with the identified function type.    -   A condition element (as described above) that specifies under        which conditions the bound key can be used (also referred to as        bound key usage condition(s)). For example, the condition(s) may        be represented in the form of one or more digests of programs.        In this case, the bound key must only be used by or on behalf of        programs whose digest is specified. Other examples of conditions        include time constraints, logical formulas, and executable        programs, as described above. This element is optional. If the        element is omitted, some default condition applies. For example,        the default condition may not restrict access to the bound key        (vacuous condition).    -   The cryptographic key (the bound key) or some data that allows        the key to be computed.    -   One or more conditions (as described above) under which the        bound key usage condition can be changed. Such changing is also        referred to as bound key migration, and the condition(s) a        migration condition(s). This element is optional. If the element        is omitted, some default condition applies. For example, the        default conditions may be “always false”, such that the digests        (if present) cannot be changed.    -   One or more conditions, under which the set of service guards        that can directly access the bound key can be changed. Such        changing is also referred to as bound key exportation, and the        condition(s) an export condition(s). This element is optional.

Cryptographic Protection of Bound Keys

Bound keys have the same cryptographic requirements as the sealedstorage and attestation functions described above (Seal, UnSeal,PKUnseal). In particular, locally generated bound keys could beprotected by any of the cryptographic implementations of the Store andRetrieve functions described above. In each case, the confidentiality ofthe bound key itself is protected and the integrity of the overall datastructure is protected in order to ensure that the different conditionsthat govern the usage of the bound key have not been corrupted. Asdescribed earlier, this can be achieved by various combinations ofsymmetric ciphers or public key encryption algorithms with MACs ordigital signatures. In one embodiment, the bound key data structure ispublic key encrypted.

Functions

In certain embodiments, bound keys can be used in one or more of thefollowing functions:

-   -   BoundSign    -   BoundQuote    -   BoundPkDecrypt    -   BoundPkUnseal    -   BoundMAC    -   BoundEncrypt    -   BoundDecrypt    -   GenBoundKey    -   BoundKeyMigrate    -   BoundKeyExport        In each of these functions, the bound key blob (the group of        bits in the data structure) and the data to be operated on by        the key contained within the bound key blob are provided as        parameters to the bound-key functions. If the key usage element        is included in the bound key blob, then the SSP ensures that the        bound key is used for the correct purpose (for example, a key        that was created with type “BoundQuoteKey” can only be used in a        BoundQuote operation).

In some implementations, the bound key is a private key of apublic/private key pair. In such implementations, the bound key blob cancontain the private key, or alternatively some data that allows the keyto be computed. For example, a private key fragment may be contained inthe bound key blob, and this fragment, in conjunction with thecorresponding public key, can be used to reconstruct the private key ofthe public/private key pair.

The BoundSign operation receives a data input that is to be signed usingthe bound key, and also receives a bound key blob. The SSP recovers theprivate signing key from the bound key blob and then generates adigitally signed message over the data input using the recovered signingkey. The SSP then outputs the digitally signed message. If the bound keyblob is corrupted or the bound key usage condition(s), if any, are notsatisfied, then the SSP does not perform the operation. The data inputcan thus be digitally signed using the recovered private key without theprivate key being revealed by the SSP.

The BoundQuote operation receives as an input data to be signed and abound key blob. The SSP recovers the private key from the bound key bloband then uses the recovered signing key to generate a signature over thedata input to the operation and the current PCR value (e.g., anidentifier, such as a digest, of the program invoking the BoundQuoteoperation) as in the Quote operation described above. The SSP thenoutputs the digitally signed message. If the bound key blob is corruptedor the bound key usage condition(s), if any, are not satisfied, then theSSP does not perform the operation. In one implementation, theBoundQuote operation is similar to the BoundSign operation, but differsin that the current PCR value is used in the BoundQuote operation.

The BoundPkDecrypt operation receives as an input ciphertext and a boundkey blob. The SSP recovers the private key from the bound key blob andthen uses the recovered private bound key to decrypt the inputciphertext. The decrypted data is then output by the BoundPkDecryptoperation. If the bound key blob is corrupted or the bound key usagecondition(s), if any, are not satisfied, then the SSP does not performthe operation.

The BoundPkUnseal operation receives as an input ciphertext and a boundkey blob. The SSP recovers the private key from the bound key blob andthen uses the private key to decrypt the input ciphertext as in thePKUnseal operation described above. The decrypted data is then output bythe BoundPkUnseal operation. If the bound key blob is corrupted or thebound key usage condition(s), if any, are not satisfied, then the SSPdoes not perform the operation.

The BoundMAC operation receives a data input, over which the MAC is tobe computed using the bound key, and also receives a bound key blob. Ifthe bound key blob is corrupted or the bound key usage condition(s), ifany, are not satisfied, then the SSP does not perform the operation.Otherwise, the SSP recovers the bound key from the bound key blob andthen generates a message authentication code (MAC) over the data inputusing the recovered bound key. The SSP then outputs the computed MAC.Thus, a MAC for the data input can be computed using the recovered boundkey without the bound key being revealed by the SSP.

The BoundEncrypt operation receives a data input, which is to beencrypted using the bound key, and also receives a bound key blob. Ifthe bound key blob is corrupted or the bound key usage condition(s), ifany, are not satisfied, then the SSP does not perform the operation.Otherwise, the SSP recovers the bound key from the bound key blob andthen encrypts the data input using the recovered bound key. The SSP thenoutputs the computed ciphertext. Thus, the data input can be encryptedusing the recovered bound key without the bound key being revealed bythe SSP.

The BoundDecrypt operation receives a data input, which is to bedecrypted using the bound key, and also receives a bound key blob. Ifthe bound key blob is corrupted or the bound key usage condition(s), ifany, are not satisfied, then the SSP does not perform the operation.Otherwise, the SSP recovers the bound key from the bound key blob andthen decrypts the data input using the recovered bound key. The SSP thenoutputs the computed plaintext. Thus, the data input can be decryptedusing the recovered bound key without the bound key being revealed bythe SSP.

The GenBoundKey operation causes the SSP to create a new bound key. Thenew bound key is a cryptographic key, and a new bound key blob isgenerated that includes the newly generated key. It is to be appreciatedthat the bound key blob does not always have to include the entire key.For example, if the newly generated key is a public/private key pair, itmay be sufficient to include the private key in the bound key blob.

The new bound key blob is bound to one or more guards—typically the SSPthat is executing the operation (e.g., by cryptographically protectingthe new bound key blob analogous to the Store function described above,or otherwise securing the new bound key blob so that it can be retrievedonly by the SSP). The GenBoundKey operation may also have parametersthat determine various aspects of the new bound key blob and datadescribing these parameters are attached to the newly generated privatekey in some integrity protected way (e.g., the data is made part of thenew bound key blob). Examples of this data, as discussed above, includethe migration condition, the bound key usage condition, and so forth.The new bound key blob is then output by the GenBoundKey operation.

In general, a bound key may be any kind of cryptographic key, includinga symmetric key or a public-private key pair. The exact key type dependson the bound key operation(s) in which it is to be used. For example, abound key to be used in BoundMAC would typically be a symmetric key,whereas a bound key to be used in BoundSign would typically be apublic/private signature key pair. The key type may be specified as aparameter to GenBoundKey.

The BoundKeyMigrate operation allows the usage condition of a bound keyto be changed. The SSP verifies that one or more migration conditionsare satisfied. Any of a variety of conditions may be used with theBoundKeyMigrate operation (e.g., any condition, analogous to thosediscussed above with reference to the Seal and UnSeal operations, thatidentifies when and/or to whom the data can be migrated). If theverification is not successfully made, then the operation fails. If theverifications is successfully made, then the guard produces a new boundkey blob, in which the bound key usage condition has been changed asrequested.

The BoundKeyExport operation instructs the SSP to change the set ofguards (SSPs) that can directly access the bound key. The SSP verifiesthat one or more conditions are satisfied. Any of a variety ofconditions may be used with the BoundKeyExport operation (e.g., anycondition, analogous to those discussed above with reference to the Sealand UnSeal operations, that identifies when and/or to whom the data canbe exported). If the verification is not successfully made, then theoperation fails. If the verification is successfully made, then the SSPchanges the cryptographic protection on the bound key blob as requested.In one embodiment, the SSP encrypts the bound key data structure withone or more new keys.

An example of a class of conditions that the creator (whether local orremote) of a bound key can specify is that the bound key may only beused on behalf of principals whose program digests have a particularvalue(s). In this case, the bound key operations check the requestingprincipal's digest after internal retrieval of the bound key blob, andfail without performing additional computation if the digest is not asspecified in the bound key blob.

A bound key blob is typically tied or bound to a particular SSP by meansof a cryptographic operation that requires a unique key of theparticular SSP to succeed. Examples of such operations are MAC, digitalsignatures, encryption, and combined encryption and integrityverification functions.

Example Bound Key Operations

In one implementation, migration is authorized by way of a localmigration certificate or an export certificate issued by the authorizingentity. The local-migration certificate is a default of RSASSA-PSS-SIGNoperation over the following data structure:

Bound-migration-info ::= SEQUENCE {   source-bound-blob-digest Digest,  dest-PCR DigestPair }

Local SSP-migration is requested using the BoundKeyMigrate operation. Toauthorize local-migration, the SSP is provided with aBound-migration-info structure referring to this bound key, and aproperly formed certificate over this structure provided by theauthorized entity. If the migration authorization is acceptable, the SSPrebinds the key for the new PCR, with all other key attributes remainingunchanged (e.g., if the key was not originally bound to a PCR value, itwill not be when rebound). The source-bound-blob-digest is the digest ofthe encrypted external form of the bound key.

Remote-migration is achieved through the BoundKeyExport function with,for example, a Bound-export-info structure signed by the authorizingentity:

Bound-export-info ::= SEQUENCE {   source-bound-blob-digest Digest,  dest-pubkey RSAPublicKey   dest-PCR DigestPair }

The authorizing entity is in complete control of the device or softwaremodule to which the key is re-bound when a key is marked exportable.

The bound key operations use a PKCiphertext, which is a sequence of typeBound-key-blob encrypted with the platform public encryption key asfollows:

Bound-key-blob ::= SEQUENCE {   message-type PKMessageType,   key-typeBound-key-type,   bound-to-PCR BOOL,   bound-to DigestPair,  migrateable Bool,   migrate-auth Digest,   exportable Bool,  export-auth Digest,   pub-key-digest Digest,   bound-keyPKCompressedPrivateKey } where: Bound-key-type ::= INTEGER {  BoundSignKey,   BoundQuoteKey   BoundDecryptKey,   BoundPkUnsealKey }

The bound-to-PCR member is a flag that indicates whether the bound-toDigest field must match the current PCR value in order for the bound keyto be used. {migrateable, migrate-auth} indicates whether the key ismigrateable, and if so under the control of what authority (ifmigrateable is false, then the migrate-auth value is unimportant).{exportable, export-auth} indicates whether the key is exportable, andif so under the control of what authority (if exportable is false, thenthe export-auth value is unimportant). Pub-key-digest is the digest ofthe corresponding public key to provide a strong binding between thePKCompressedPrivateKey and the public key that is needed to recover theprivate key.

In one implementation, if a bound key is created locally with theGenBoundKey function, the SSP creates a signature over a data structuredetailing the public properties of the key that was just generated, andthe configuration of the system during bound key export.

Bound-key-pub-info ::= SEQUENCE {   message-type PKMessageType, //sspV1BoundKeyGenMessage   sig-nonce Digest,   key-type Bound-key-type,  bound-to-PCR BOOL,   bound-to DigestPair,   migrateable Bool,  migrate-auth Digest,     exportable Bool,   export-auth Digest,  creator-PCR DigestPair   bound-pub-key Digest }

In this data structure, key-type, bound-to-PCR, bound-to, migrateable,migrate-auth, exportable, and export-auth are the bound keycharacteristics of the newly generated key. Creator-PCR is the PCR thatwas active when the key was exported, and bound-pub-key is the digest ofthe newly created public key. sig-nonce is the digest-sized value passedin when bound-key generation was requested.

Exemplary definitions of the BoundSign, BoundQuote, BoundPkDecrypt,BoundPkUnseal, GenBoundKey, BoundKeyMigrate, and BoundKeyExportoperations are as follows.

BoundSign Definition SSP_STATUS BoundSign(   [in] PKCiphertextBoundKeyBlob,   [in] RSAPublicKey PubPartOfBoundKey,   [in] BITSTRINGDataToBeSigned   [out] PKSignature sig-blob ) Parameters BoundSign-Input::= {   ordinal INTEGER,   bound-key BoundKeyBlob,   bound-pub-keyRSAPublicKey,   data-to-be-signed OCTET STRING } BoundSign-output ::= {  ordinal INTEGER,   status INTEGER,   sig-blob PKSignature } ReturnValues SSP_SUCCESS SSP_CRYPTO_ERROR SSP_BAD_DATA_ERROR SSP_UNSEAL_ERROR

Comments

The BoundSign operation takes PKciphertext of type sspV1BoundKeycontaining a BoundKeyBlob of type BoundSignKey and the correspondingpublic key. If either of these conditions is not met, or if the sequencefails to decode, then the operation fails with SSP_CRYPTO_ERROR.

If Bound-to-PCR is set, the SSP checks that the current PCR value is asspecified in the Bound-key-blob sequence. If it is not, the SSP returnsSSP_CRYPTO_ERROR.

Finally, the SSP signs the input message with the decrypted private key.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The BoundSign operation implements the following actions:

1. The SSP tests if the Algorithmldentifier in pk-sealed-blob issspV1BoundKey.

2. The SSP internally decrypts SealedBlob according to the defaultimplementation of RSAES-OAEP-DECRYPT as specified in PKCS #1 V2.1,obtaining a plaintext message M.

3. If the output of the decoding operation is “decoding error” returnSSP_CRYPTO_ERROR with Secret set to zero.

4. Otherwise, the recovered message M should be a DER encoding of theform Bound-key-blob, with type BoundSignKey. If not, the SSP should emitSSP_CRYPTO_ERROR.

5. If bound-to-PCR is TRUE, then the bound-to should be compared to thecurrent PCR value. If the value is not the same, the SSP should outputSSP_CRYPTO_ERROR.

6. The SSP then recovers the bound private key using the associatedpublic key provided. If this fails, the SSP returns SSP_CRYPTO_ERROR. Ifit succeeds, the SSP uses the recovered private key bound-key togenerate a signed message over the input message DataToBeSignedaccording to the default implementation of RSASSA-PSS-SIGN as specifiedin PKCS #1 V2.1 If the function returns an error, then returnSSP_CRYPTO_ERROR with SigBlob set to 0.

7. Return SSP_SUCCESS

BoundQuote Definition SSP_STATUS BoundQuote(   [in] PKCiphertextBoundKeyBlob,   [in] DIGEST DataToBeSigned   [out] PKSignature sig-blob) Parameters BoundQuote-Input ::= {   ordinal INTEGER,   bound-keyBoundKeyBlob,   bound-pub-key RSAPublicKey,   data-to-be-quoted Digest }BoundQuote-output ::= {   ordinal INTEGER,   status INTEGER,   sig-blobPKSignature } Return Values SSP_SUCCESS SSP_CRYPTO_ERRORSSP_BAD_DATA_ERROR SSP_UNSEAL_ERROR

Comments

The BoundQuote operation takes PKciphertext of type sspV1BoundKeycontaining a BoundKeyBlob of type BoundQuoteKey. If either of theseconditions is not met, or if the sequence fails to decode, then theoperation fails with SSP_CRYPTO_ERROR.

If Bound-to-PCR is set, the SSP checks that the current PCR value is asspecified in the Bound-key-blob sequence. If it is not, the SSP returnsSSP_CRYPTO_ERROR.

Finally, the SSP quotes the input message with the decrypted privatekey.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The BoundQuote operation implements the following actions:

1. The SSP tests if the AlgorithmIdentifier in pk-sealed-blob is sspV1BoundKey.

2. The SSP internally decrypts SealedBlob according to the defaultimplementation of RSAES-OAEP-DECRYPT as specified in PKCS #1 V2.1,obtaining a plaintext message M.

3. If the output of the decoding operation is “decoding error” returnSSP_CRYPTO_ERROR with Secret set to zero.

4. Otherwise, the recovered message M should be a DER encoding of theform Bound-key-blob, with type BoundQuoteKey. If not the SSP should emitSSP_CRYPTO_ERROR.

5. If bound-to-PCR is true, then the bound-to should be compared to thecurrent PCR value. If the value is not the same, the SSP should outputSSP_CRYPTO_ERROR.

6. The SSP then uses the recovered private key fragment and the publickey to reconstruct the private key. The private key can be reconstructedas follows. In general, RSA keys are made of a number N=p*q (N is theproduct of two prime numbers p and q.), and two exponents e (encryptionexponent) and d (decryption exponent). N and e form the public key; d isthe private key. In general, d is as long as N (e.g. 2048 bits). If thefactorization of N is known (i.e., if p and q are known) then theprivate key d can be readily determined. Note that p and q are only halfas long as N. So, rather than storing d as the private key, we store p.Then, given the public key N, e and p, the value q=N/p can be computed,and then the value d determined given p and q.

The private key is then used to generate a signature message over theinput message DataToBeSigned and the current PCR value according to thespecification in the Quote operation defined above. If the functionreturns an error then return SSP_CRYPTO_ERROR with SigBlob set to 0.

7. Return SSP_SUCCESS

BoundPkDecrypt Definition SSP_STATUS BoundPkDecrypt(   [in] PKCiphertextBoundKeyBlob,   [in] RSAPublicKey BoundPubKey,   [in] PKCiphertextDataToBeDecrypted,   [out] Secret decryptedData ) ParametersBoundPkDecrypt-Input ::= {   ordinal INTEGER,   bound-key BoundKeyBlob,  bound-pub-key RSAPublicKey,   pk-sealed-blob PKCiphertext }BoundPkDecrypt-output ::= {   ordinal INTEGER,   status INTEGER,  d-blob Secret } Return Values SSP_SUCCESS SSP_UNSEAL_ERRORSSP_CRYPTO_ERROR SSP_BAD_DATA_ERROR

Comments

The BoundPkDecrypt operation takes PKciphertext of type sspV1BoundKeycontaining a BoundKeyBlob of type BoundDecryptKey. If either of theseconditions is not met, or if the sequence fails to decode, then theoperation fails with SSP_CRYPTO_ERROR.

If Bound-to-PCR is set, the SSP checks that the current PCR value is asspecified in the Bound-key-blob sequence. If it is not, the SSP returnsSSP_CRYPTO_ERROR.

Finally, the SSP decrypts the input message with the decrypted privatekey from the bound-blob.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The BoundPkDecrypt operation implements the following actions:

1. The SSP tests if the AlgorithmIdentifier in pk-sealed-blob issspV1BoundKey.

2. The SSP internally decrypts SealedBlob according to the defaultimplementation of RSAES-OAEP-DECRYPT as specified in PKCS #1 V2.1,obtaining a plaintext message M.

3. If the output of the decoding operation is “decoding error,” returnSSP_CRYPTO_ERROR with Secret set to zero.

4. Otherwise, the recovered message M should be a DER encoding of theform Bound-key-blob, with type BoundDecryptKey. If not, the SSP shouldemit SSP_CRYPTO_ERROR.

5. If bound-to-PCR is true, then the bound-to should be compared to thecurrent PCR value, if the value is not the same, the SSP should outputSSP_CRYPTO_ERROR.

6. The SSP recovers the private key using the provided public key. Theprivate key can be recovered as discussed above in the BoundQuoteoperation. It then uses the recovered private bound-key to decrypt thepk-sealed-blob using the default implementation of RSAES-OAEP-DECRYPT asspecified in PKCS #1 V2.1, obtaining a plaintext message M.

7. The SSP sets d-blob to M.

8. Return SSP_SUCCESS.

BoundPkUnseal Definition SSP_STATUS BoundPKUnseal(   [in] PKCiphertextBoundKeyBlob,   [in] RSAPublicKey BoundPubKey,   [in] PKCiphertextDataToBeUnsealed   [out] Secret decryptedData ) ParametersBoundPKUnseal-Input ::= {   ordinal INTEGER,   bound-key BoundKeyBlob,  bound-pub-key RSAPublicKey,   pk-sealed-blob PKCiphertext }BoundPKUnseal-output ::= {   ordinal INTEGER,   status INTEGER,   d-blobSecret } Return Values SSP_SUCCESS SSP_UNSEAL_ERROR SSP_CRYPTO_ERRORSSP_BAD_DATA_ERROR

Comments

The BoundPkUnseal operation takes PKciphertext of type sspV1BoundKeycontaining a BoundKeyBlob of type BoundPKUnsealKey. If either of theseconditions is not met, or if the sequence fails to decode, then theoperation fails with SSP_CRYPTO_ERROR.

If Bound-to-PCR is set, the SSP checks that the current PCR value is asspecified in the Bound-key-blob sequence. If it is not, the SSP returnsSSP_CRYPTO_ERROR.

Finally, the SSP uses PK_Unseal to unseal the input message with thedecrypted private key from the bound-blob.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The BoundPkUnseal operation must implement the following steps:

1. The SSP tests if the AlgorithmIdentifier in pk-sealed-blob issspV1BoundKey.

2. The SSP internally decrypts SealedBlob according to the defaultimplementation of RSAES-OAEP-DECRYPT as specified in PKCS #1 V2.1,obtaining a plaintext message M.

3. If the output of the decoding operation is “decoding error,” returnSSP_CRYPTO_ERROR with Secret set to zero.

4. Otherwise, the recovered message M should be a DER encoding of theform Bound-key-blob, with type BoundDecryptKey. If not, the SSP shouldemit SSP_CRYPTO_ERROR.

5. If bound-to-PCR is true, then the bound-to should be compared to thecurrent PCR value. If the value is not the same, the SSP should outputSSP_CRYPTO_ERROR.

6. The SSP recreates the private key using the bound key blob. Theprivate key can be recovered as discussed above in the BoundQuoteoperation. It then uses the recovered private bound-key to unseal thepk-sealed-blob using the steps described in the PK_Unseal command.

7. If the PCR named in the unsealed blob does not match the current PCR,the SSP returns SSP_CRYPTO_ERROR.

8. Otherwise, the SSP sets d-blob to M.

9. Return SSP_SUCCESS.

GenBoundKey Definition SSP_STATUS GenBoundKey(   [in] BoundKeyTypeKeyType,   [in] BOOL BoundToPcr,   [in] DIGEST BoundTo[2],   [in] BOOLmigrateable,   [in] DIGEST migrationAuthority,   [in] BOOL exportable,  [in] DIGEST exportAuthority,   [in] DIGEST SigNonce,   [out] BoundKeybound-key,   [out] PKPublickey newPubKey,   [out] PKSignatureboundKeyQuoteBlob ) Parameters GenBoundKey-Input ::= {   ordinalINTEGER,   key-type Bound-key-type,   bound-to-pcr BOOL,   bound-toDigestPair,   migrateable BOOL,   migrate-auth Digest,   exportableBOOL,   export-auth Digest,   sig-nonce Digest } GenBoundKey-output ::={   ordinal INTEGER,   status INTEGER,   bound-blob PKCiphertext,  bound-pub RSAPublicKey,   sig-blob PKSignature } Return ValuesSSP_SUCCESS SSP_BAD_DATA_ERROR

Comments

The GenBoundKey operation causes the SSP to generate a new bound-keyblob containing the newly generated private key. The bound-key blob isencrypted with the SSP's own public key.

GenBoundKey also outputs the public key of the newly generated key-pair,a quote-signature that indicates that the SSP generated the key, itscharacteristics, and the PCR value when the key was generated.

The caller of GenBoundKey also indicates the type of bound-key to becreated: whether it is for signing, quoting, unsealing withBoundPkUnseal, or decrypting with BoundPkDecrypt. The caller alsospecifies whether the bound-key should be bound to a PCR, and if so, thePCR value to which it is bound.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The GenBoundKey operation implements the following actions:

1. The SSP generates a new public private RSA key-pair. The SSP canoptionally generate key-pairs when the SSP is otherwise idle, and storea small cache of keys in non-volatile memory for immediate retrieval.

2. The SSP internally generates a bound-key structure containing thenewly generate private key and the bound-key type and other parametersprovided by the caller.

3. The SSP encrypts the bound-key blob with the platform publicencryption key.

4. The SSP generates a signed blob of a bound-key-pub-info containingthe properties of the newly created key, the PCR values at the time ofkey creation and the supplied nonce.

5. The SSP outputs the encrypted bound-key blob, the newly generatedpublic key, and the quoted key blob.

6. Return SSP_SUCCESS.

BoundKeyMigrate Definition SSP_STATUS BoundKeyMigrate(   [in]PKCiphertext BoundKeyBlob,   [in] RSAPublicKey PubPartOfBoundKey,   [in]BOUND_MIGRATION_INFO MigrationInfo,   [in] RSA_SIG SigOnMigrationInfo )Parameters GenBoundKey-Input ::= {   ordinal INTEGER,   migration-infoBound-migration-info,   migration-pubkey RSAPublicKey,   migration-authPKSignature } GenBoundKey-output ::= {   ordinal INTEGER,   statusINTEGER,   re-bound-blob PKCiphertext, } Return Values SSP_SUCCESSSSP_BAD_DATA_ERROR

Comments

The BoundKeyMigrate operation instructs the SSP to re-bind a key to adifferent PCR value in a controlled manner. The original key-creator,local or remote, names the migration-authorization entity. Only boundkeys marked migrateable can be migrated, and these will only be migratedif the SSP is provided with an appropriated signed Boundmigration-infostructure. Appropriately signed means signed with the public key whosedigest is contained within the bound key blob. The other bound keyattributes are not changed.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The BoundKeyMigrate operation implements the following actions:

1. The SSP internally decrypts the bound-key structure and interprets itas a Bound-key-blob. If the decoding fails, the SSP returnsSSP_CRYPTO_ERROR.

2. The SSP validates that Bound-export-info refers to the same key, thatthe signature is properly formed, and that the digest of the public keyof the signer is as named in the ‘migrateable’ field of theBound-key-blob.

3. The SSP checks that the key is migrateable. If not, the SSP returnsSSP_CRYPO_ERROR

4. If the key is bound to a PCR, the SSP checks that the current PCR isthat named in the key-blob.

5. The SSP replaces the PCR value with that named in the dest-PCR fieldof the Bound-migration-info.

6. The SSP re-encrypts the bound-key-blob, and exports the re-encryptedstructure.

6. Return SSP_SUCCESS.

BoundKeyExport Definition SSP_STATUS BoundKeyExport(   [in] PKCiphertextBoundKeyBlob,   [in] RSAPublicKey PubPartOfBoundKey,   [in]BOUND_EXPORT_INFO ExportInfo,   [in] RSA_SIG SigOnExportInfoInfo,  [out] PKCipherText ReBoundBlob ) Parameters BoundKeyExport-Input ::= {  ordinal INTEGER,   bound-key PKCipherText,   bound-pub-keyRSAPublicKey,   export-info Bound-export-info,   export-authPKSignature, } GenBoundKey-output ::= {   ordinal INTEGER,   statusINTEGER,   re-bound-blob PKCiphertext, } Return Values SSP_SUCCESSSSP_BAD_DATA_ERROR

Comments

The BoundKeyExport operation instructs the SSP to export the privatepart of a bound key to a remote entity in a format consistent with boundkeys on the source device in a controlled manner. The originalkey-creator, local or remote, names the export-authorization entity.Only bound keys marked exportable can be exported, and these will onlybe exported if the SSP is provided with an appropriated signedBound-export-info structure. Appropriately signed means signed with thepublic key whose digest is contained within the original bound key blob.BoundKeyExport allows appropriately authorized callers to specify thepublic key and PCR value of the target entity to which the key should berebound. There is no specific requirement that the external entity be anSSP, but the newly bound blob follows bound-key conventions to allowremote SSPs to consume exported bound keys directly.

Access Policy

Allowed=FeatureEnable.MainEnable &(FeatureEnable.UsePrivKey==All|FeatureEnable.UsePrivKey==AuthSL

& SLKnown & AuthPCR[CurrentSL].UsePrivKey)

Actions

The BoundKeyExport operation implements the following actions:

1. The SSP internally decrypts the bound-key structure and interprets itas a Bound-key-blob. If the decoding fails, the SSP returnsSSP_CRYPTO_ERROR.

2. The SSP validates that Bound-export-info refers to the same key, thatthe signature is properly formed, and that the digest of the public keyof the signer is as named in the ‘export’ field of the Bound-key-blob.

3. The SSP checks that the key is exportable. If not, the SSP returnsSSP_CRYPO_ERROR.

4. If the key is bound to a PCR, the SSP checks that the current PCR isthat named in the key-blob.

5. The SSP internally generates a new bound-key-blob structurecontaining the parameters from the original bound-key-blob structure andthe new PCR value supplied in Bound-export-info. All other parametersremain the same.

6. The SSP encrypts the new bound-key blob with the public encryptionkey supplied in Bound-export-info.

7. The newly bound key is exported.

8. Return SSP_SUCCESS.

General Computer Environment

FIG. 12 illustrates a general computer environment 400, which can beused to implement the techniques described herein. The computerenvironment 400 is only one example of a computing environment and isnot intended to suggest any limitation as to the scope of use orfunctionality of the computer and network architectures. Neither shouldthe computer environment 400 be interpreted as having any dependency orrequirement relating to any one or combination of components illustratedin the exemplary computer environment 400.

Computer environment 400 includes a general-purpose computing device inthe form of a computer 402. Computer 402 can be used, for example, toimplement principal 102 and guard 104 of FIG. 1, or the layers of FIG.2. The components of computer 402 can include, but are not limited to,one or more processors or processing units 404 (optionally including oneor more security processors or coprocessors (such as an SSP) and/or oneor more cryptographic processors or coprocessors), a system memory 406,and a system bus 408 that couples various system components includingthe processor 404 to the system memory 406.

The system bus 408 represents one or more of any of several types of busstructures, including a memory bus or memory controller, a peripheralbus, an accelerated graphics port, and a processor or local bus usingany of a variety of bus architectures. By way of example, sucharchitectures can include an Industry Standard Architecture (ISA) bus, aMicro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, aVideo Electronics Standards Association (VESA) local bus, and aPeripheral Component Interconnects (PCI) bus also known as a Mezzaninebus.

Computer 402 typically includes a variety of computer readable media.Such media can be any available media that is accessible by computer 402and includes both volatile and non-volatile media, removable andnon-removable media.

The system memory 406 includes computer readable media in the form ofvolatile memory, such as random access memory (RAM) 410, and/ornon-volatile memory, such as read only memory (ROM) 412. A basicinput/output system (BIOS) 414, containing the basic routines that helpto transfer information between elements within computer 402, such asduring start-up, is stored in ROM 412. RAM 410 typically contains dataand/or program modules that are immediately accessible to and/orpresently operated on by the processing unit 404.

Computer 402 may also include other removable/non-removable,volatile/non-volatile computer storage media. By way of example, FIG. 12illustrates a hard disk drive 416 for reading from and writing to anon-removable, non-volatile magnetic media (not shown), a magnetic diskdrive 418 for reading from and writing to a removable, non-volatilemagnetic disk 420 (e.g., a “floppy disk”), and an optical disk drive 422for reading from and/or writing to a removable, non-volatile opticaldisk 424 such as a CD-ROM, DVD-ROM, or other optical media. The harddisk drive 416, magnetic disk drive 418, and optical disk drive 422 areeach connected to the system bus 408 by one or more data mediainterfaces 426. Alternatively, the hard disk drive 416, magnetic diskdrive 418, and optical disk drive 422 can be connected to the system bus408 by one or more interfaces (not shown).

The disk drives and their associated computer-readable media providenon-volatile storage of computer readable instructions, data structures,program modules, and other data for computer 402. Although the exampleillustrates a hard disk 416, a removable magnetic disk 420, and aremovable optical disk 424, it is to be appreciated that other types ofcomputer readable media which can store data that is accessible by acomputer, such as magnetic cassettes or other magnetic storage devices,flash memory cards, CD-ROM, digital versatile disks (DVD) or otheroptical storage, random access memories (RAM), read only memories (ROM),electrically erasable programmable read-only memory (EEPROM), and thelike, can also be utilized to implement the exemplary computing systemand environment.

Any number of program modules can be stored on the hard disk 416,magnetic disk 420, optical disk 424, ROM 412, and/or RAM 410, includingby way of example, an operating system 426, one or more applicationprograms 428, other program modules 430, and program data 432. Each ofsuch operating system 426, one or more application programs 428, otherprogram modules 430, and program data 432 (or some combination thereof)may implement all or part of the resident components that support thedistributed file system.

A user can enter commands and information into computer 402 via inputdevices such as a keyboard 434 and a pointing device 436 (e.g., a“mouse”). Other input devices 438 (not shown specifically) may include amicrophone, joystick, game pad, satellite dish, serial port, scanner,and/or the like. These and other input devices are connected to theprocessing unit 404 via input/output interfaces 440 that are coupled tothe system bus 408, but may be connected by other interface and busstructures, such as a parallel port, game port, or a universal serialbus (USB).

A monitor 442 or other type of display device can also be connected tothe system bus 408 via an interface, such as a video adapter 444. Inaddition to the monitor 442, other output peripheral devices can includecomponents such as speakers (not shown) and a printer 446 which can beconnected to computer 402 via the input/output interfaces 440.

Computer 402 can operate in a networked environment using logicalconnections to one or more remote computers, such as a remote computingdevice 448. By way of example, the remote computing device 448 can be apersonal computer, portable computer, a server, a router, a networkcomputer, a peer device or other common network node, and the like. Theremote computing device 448 is illustrated as a portable computer thatcan include many or all of the elements and features described hereinrelative to computer 402.

Logical connections between computer 402 and the remote computer 448 aredepicted as a local area network (LAN) 450 and a general wide areanetwork (WAN) 452. Such networking environments are commonplace inoffices, enterprise-wide computer networks, intranets, and the Internet.

When implemented in a LAN networking environment, the computer 402 isconnected to a local network 450 via a network interface or adapter 454.When implemented in a WAN networking environment, the computer 402typically includes a modem 456 or other means for establishingcommunications over the wide network 452. The modem 456, which can beinternal or external to computer 402, can be connected to the system bus408 via the input/output interfaces 440 or other appropriate mechanisms.It is to be appreciated that the illustrated network connections areexemplary and that other means of establishing communication link(s)between the computers 402 and 448 can be employed.

In a networked environment, such as that illustrated with computingenvironment 400, program modules depicted relative to the computer 402,or portions thereof, may be stored in a remote memory storage device. Byway of example, remote application programs 458 reside on a memorydevice of remote computer 448. For purposes of illustration, applicationprograms and other executable program components such as the operatingsystem are illustrated herein as discrete blocks, although it isrecognized that such programs and components reside at various times indifferent storage components of the computing device 402, and areexecuted by the data processor(s) of the computer.

Various modules and techniques may be described herein in the generalcontext of computer-executable instructions, such as program modules,executed by one or more computers or other devices. Generally, programmodules include routines, programs, objects, components, datastructures, etc. that perform particular tasks or implement particularabstract data types. Typically, the functionality of the program modulesmay be combined or distributed as desired in various embodiments.

An implementation of these modules and techniques may be stored on ortransmitted across some form of computer readable media. Computerreadable media can be any available media that can be accessed by acomputer. By way of example, and not limitation, computer readable mediamay comprise “computer storage media” and “communications media.”

“Computer storage media” includes volatile and non-volatile, removableand non-removable media implemented in any method or technology forstorage of information such as computer readable instructions, datastructures, program modules, or other data. Computer storage mediaincludes, but is not limited to, RAM, ROM, EEPROM, flash memory or othermemory technology, CD-ROM, digital versatile disks (DVD) or otheroptical storage, magnetic cassettes, magnetic tape, magnetic diskstorage or other magnetic storage devices, or any other medium which canbe used to store the desired information and which can be accessed by acomputer.

“Communication media” typically embodies computer readable instructions,data structures, program modules, or other data in a modulated datasignal, such as carrier wave or other transport mechanism. Communicationmedia also includes any information delivery media. The term “modulateddata signal” means a signal that has one or more of its characteristicsset or changed in such a manner as to encode information in the signal.By way of example, and not limitation, communication media includeswired media such as a wired network or direct-wired connection, andwireless media such as acoustic, RF, infrared, and other wireless media.Combinations of any of the above are also included within the scope ofcomputer readable media.

Although the description above uses language that is specific tostructural features and/or methodological acts, it is to be understoodthat the invention defined in the appended claims is not limited to thespecific features or acts described. Rather, the specific features andacts are disclosed as exemplary forms of implementing the invention.

1. A method comprising: obtaining data to be sealed and one or moreconditions that are to be satisfied in order for the data to beunsealed; and encrypting, using public key encryption, both the data andthe one or more conditions to generate a ciphertext that includes boththe encrypted data and the encrypted one or more conditions, wherein thedata is not unsealed if the one or more conditions are not satisfied,wherein one of the one or more conditions comprises a logical formula tobe evaluated, and wherein the data can be unsealed only if the logicalformula evaluates true.
 2. A method as recited in claim 1, wherein thedata comprises a cryptographic key.
 3. A method as recited in claim 1,wherein obtaining the data comprises receiving the data as part of aPKSeal operation.
 4. A method as recited in claim 1, wherein the logicalformula comprises a statement written in first order logic.
 5. A methodcomprising: invoking an operation to seal data; and receiving, inresponse to invoking the operation, a ciphertext including both the dataand one or more conditions that are to be satisfied in order for thedata to be unsealed, wherein one of the one or more conditions comprisesa logical formula to be evaluated and wherein the data can be unsealedonly if the logical formula evaluates true, wherein the data is notunsealed if the one or more conditions are not satisfied, and whereinthe data and the one or more conditions are encrypted using public keyencryption.
 6. A method as recited in claim 5, wherein the operationcomprises a PKSeal operation.
 7. A method as recited in claim 5, whereininvoking the operation comprises passing the data as an input to theoperation.
 8. A method as recited in claim 5, wherein invoking theoperation comprises passing at least one of the one or more conditionsas an input to the operation.
 9. A method as recited in claim 5, whereinthe data comprises a cryptographic key.
 10. A method as recited in claim5, wherein the logical formula comprises a statement written in firstorder logic.
 11. A method comprising: invoking an operation to haveciphertext decrypted; and receiving, in response to invoking theoperation, decrypted data from the ciphertext only if one or moreconditions included in the ciphertext are satisfied, wherein the one ormore conditions comprises a logical formula to be evaluated true, andwherein the ciphertext is decrypted using public key decryption.
 12. Amethod as recited in claim 11, wherein the operation comprises aPKUnseal operation.
 13. A method as recited in claim 11, whereininvoking the operation comprises passing the ciphertext as an input tothe operation.
 14. A method as recited in claim 11, wherein invoking theoperation comprises passing a pointer to the ciphertext as an input tothe operation.
 15. A method as recited in claim 11, wherein the datacomprises a cryptographic key.
 16. A method as recited in claim 11,wherein the logical formula comprises a statement written in first orderlogic.